package com.ntdpmap;

import com.google.android.gms.maps.model.LatLng;

import android.content.Context;

public class RoomData3 {
	
	//origin coordinate
	public static final int xPixel = 1076;
	public static final int yPixel = 2337;
	public static final double oLat = 33.253653;
	public static final double oLong = -97.153020;
	
	//conversion ratios
	public static final double p2f = 30/85;
	public static final double f2Lat = 1/363873.809868796;
	public static final double f2Long = 1/305723.848803696;
	
	private MySQLiteHelper db;
	
	public RoomData3(Context context){
		db = new MySQLiteHelper(context);
		String Room;
		double x_Cord;
		double y_Cord;
		
		
		Room ="B192";
		y_Cord = Lat(2234);
		x_Cord =  Long(1299);
		db.addRoom(Room, y_Cord, x_Cord);
		
		Room ="B190";
		y_Cord = Lat(2146);
		x_Cord =  Long(1302);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B140
		Room ="B140";
		y_Cord = Lat(1970);
		x_Cord =  Long(1294);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B142
		Room ="B142";
		y_Cord = Lat(1965);
		x_Cord =  Long(1222);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B155
		Room ="B155";
		y_Cord = Lat(1966);
		x_Cord =  Long(1135);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B158
		Room ="B158";
		y_Cord = Lat(2045);
		x_Cord =  Long(1062);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B157
		Room ="B157";
		y_Cord = Lat(1948);
		x_Cord =  Long(1061);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B185
		Room ="B185";
		y_Cord = Lat(2194);
		x_Cord =  Long(1096);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B131
		Room ="B131";
		y_Cord = Lat(1856);
		x_Cord =  Long(1298);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B129
		Room ="B129";
		y_Cord = Lat(1778);
		x_Cord =  Long(1298);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B135
		Room ="B135";
		y_Cord = Lat(1747);
		x_Cord =  Long(1216);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B112
		Room ="B112";
		y_Cord = Lat(1773);
		x_Cord =  Long(1121);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B110
		Room ="B110";
		y_Cord = Lat(1812);
		x_Cord =  Long(1051);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B111
		Room ="B111";
		y_Cord = Lat(1854);
		x_Cord =  Long(1064);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B186
		Room ="B186";
		y_Cord = Lat(2292);
		x_Cord =  Long(1027);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B188
		Room ="B188";
		y_Cord = Lat(2137);
		x_Cord =  Long(1200);
		db.addRoom(Room, y_Cord, x_Cord);
		//Room B187
		Room ="B187";
		y_Cord = Lat(2234);
		x_Cord =  Long(1198);
		db.addRoom(Room, y_Cord, x_Cord);
		
	}
	
	public double Lat(double y)
	{
		return (y-xPixel)*p2f*f2Lat+oLat;
	}
	
	public double Long(double x)
	{
		return (x-yPixel)*p2f*f2Long+oLong;
	}
	
	public LatLng getRoom(String room){
		double Latitude = db.getLat(room);
		double Longitude = db.getLong(room);
		LatLng point = new LatLng(Latitude,Longitude);
		return point;
	}
}
